package concrete_mediator;

import concrete_colleague.HouseOwner;
import concrete_colleague.Tenant;
import lombok.Data;
import mediator.Mediator;
import colleague.Person;

@Data
public class MediatorStructure implements Mediator {

    private HouseOwner houseOwner;
    private Tenant tenant;

    @Override
    public void contact(String message, Person person) {
        if(person instanceof HouseOwner){
            tenant.getMessage(message);
            return;
        }
        houseOwner.getMessage(message);
    }
}
